// JavaScript Document
// Check settings made above based on cookie settings
//**** NOTE MENUS MUST BE SET TO DISPLAY:NONE IN ADMIN CSS BY DEFAULT ******
	function checkMenuSettings() {
		if($.cookie) {
			if ($.cookie('settingsMenuCookie') == 'open') {
				$('#settingsMenu').show();
			};
			if ($.cookie('homeMenuCookie') == 'open') {
				$('#homeMenu').show();
			};
			if ($.cookie('meetingMenuCookie') == 'open') {
				$('#meetingMenu').show();
			};
			if ($.cookie('eventMenuCookie') == 'open') {
				$('#eventMenu').show();
			};
			if ($.cookie('contactsMenuCookie') == 'open') {
				$('#contactsMenu').show();
			};
			//$.cookie('the_cookie', 'the_value');
		}
	}
$(document).ready(function() {
	//settings
	$('#menu_settings').click(function () {
		window.location = "settings.php";
		});
	$('#settings_toggle').click(function() {
 	 	$('#settingsMenu').slideToggle('100', function() {
		 // Animation complete.
		 //set php session variable used to remember state of toggle while browser open
		 	if( $('#settingsMenu').is(':visible') ) {
				$.cookie('settingsMenuCookie' , 'open');
					}
				else {
				 $.cookie('settingsMenuCookie' , 'closed');
				}
  			});
		});
	//Home
	$('#menu_home').click(function () {
		window.location = "homeDashboard.php";
	});
	$('#home_toggle').click(function() {
		$('#homeMenu').slideToggle('100', function() {
			 // Animation complete.
			 //set php session variable used to remember state of toggle while browser open
			 if( $('#homeMenu').is(':visible') ) {
				$.cookie('homeMenuCookie' , 'open');
					}
				else {
				 $.cookie('homeMenuCookie' , 'closed');
				}
		});
	});
	//meetings
	$('#menu_meetings').click(function () {
		window.location = "meetings.php";
	});
	$('#meetings_toggle').click(function() {
		$('#meetingMenu').slideToggle('100', function() {
			 // Animation complete.
			 //set php session variable used to remember state of toggle while browser open
			 if( $('#meetingMenu').is(':visible') ) {
				$.cookie('meetingMenuCookie' , 'open');
					}
				else {
				 $.cookie('meetingMenuCookie' , 'closed');
				}
		});
	});
	//events
	$('#menu_newsEvents').click(function () {
		window.location = "news_eventsDashboard.php";
	});
	$('#event_toggle').click(function() {
 	 	$('#eventMenu').slideToggle('100', function() {
    	// Animation complete.
		//set php session variable used to remember state of toggle while browser open
		 if( $('#eventMenu').is(':visible') ) {
			$.cookie('eventMenuCookie' , 'open');
				}
			else {
			 $.cookie('eventMenuCookie' , 'closed');
			}
  		});
	});
	//contacts
	$('#menu_contacts').click(function () {
		window.location = "contacts.php";
	});
	$('#contacts_toggle').click(function() {
 	 	$('#contactsMenu').slideToggle('100', function() {
		 // Animation complete.
		 //set php session variable used to remember state of toggle while browser open
		  if( $('#contactsMenu').is(':visible') ) {
			$.cookie('contactsMenuCookie' , 'open');
				}
			else {
			 $.cookie('contactsMenuCookie' , 'closed');
		  }
  		});
	});
});